package cate.game.role.res.guild.po.envelope;

import cate.game.role.Role;
import cate.game.role.show.avatar.AvatarVO;
import cate.game.role.show.frame.HeadFrameVO;
import cate.game.role.show.icon.HeadIconVO;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "发红包的成员信息")
public class GuildEnvelopeIssuerPO {
    @NoteField(value = "发红包的成员ID")
    public String uid;

    @NoteField(value = "发红包的成员姓名")
    public String name;

    @NoteField(value = "头像")
    public HeadIconVO headIcon;

    @NoteField("头像框")
    public HeadFrameVO headFrame;

    @NoteField("冒险形象")
    public AvatarVO avatar;

    @NoteField("角色性别")
    public byte sex;

    @NoteField("角色等级")
    public int level;

    @NoteField(value = "红包发放个数")
    public int num;

    @NoteField(value = "红包总价值", detail = "金币为单位")
    public long value;

    public GuildEnvelopeIssuerPO() {
    }

    public GuildEnvelopeIssuerPO(Role role, int value) {
        uid = role.getUid();
        name = role.getBase().name;
        headIcon = role.getBase().headIcon;
        level = role.getBase().level;
        headFrame = role.getBase().headFrame;
        sex = role.getBase().sex;
        avatar = role.getBase().avatar;
        num = 1;
        this.value = value;
    }

    public void updateBase(Role role) {
        name = role.getBase().name;
        headIcon = role.getBase().headIcon;
        level = role.getBase().level;
        headFrame = role.getBase().headFrame;
        sex = role.getBase().sex;
        avatar = role.getBase().avatar;
    }
}
